/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.bld.modulo.web.bean.municipio;

import br.com.bld.model.municipio.MunicipioBe;
import br.com.bld.model.municipio.MunicipioEntity;
import java.io.Serializable;
import java.sql.SQLException;
import java.util.Collection;
import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedBean;
import javax.inject.Named;

/**
 *
 * @author Pedro
 */
@Named(value = "municipioSessionBean")
@ManagedBean
@RequestScoped
public class MunicipioSessionBean implements Serializable {

    /**
     * Creates a new instance of MunicipioSessionBean
     */
    public MunicipioSessionBean() {
    }

    public Collection<MunicipioEntity> getMunicipio() {
        
        Collection<MunicipioEntity> resposta = null;
        
        try {

            MunicipioBe be = new MunicipioBe();
            
            resposta = be.selecionarTodos().values();

        } catch (SQLException e) {
            e.printStackTrace();
        }
        
        return resposta;
    }

}
